home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / unix / lh_ubugs / lh_u2.bug < prev   
Encoding:
Text File  |  1990-03-27  |  1.9 KB  |  69 lines

  1. Article 332 (10 more) in comp.sources.bugs:
  2. From: jwilke@cosmo.UUCP (Joerg Wilke)
  3.  
  4. Subject: New Bug in LHARC using MSDOS
  5. Keywords: Divide by zero for files with lenth 0
  6. Message-ID: <5238@balu.UUCP>
  7. Date: 24 Mar 90 23:01:22 GMT
  8. Sender: news@balu.UUCP
  9. Reply-To: jwilke@cosmo.UUCP (Joerg Wilke)
  10. Organization: CosmoNet, D-3000 Hannover 1, FRG
  11. Lines: 57
  12.  
  13. I have compiled LHARC using MSDOS 3.3 and MS-C 5.1 and am quite
  14. happy with it. It's convenient and portable. Thanks to all involved to it.
  15.  
  16. But:
  17. If LHARC was extracting files with length zero, it fails with an 'R6003:
  18. Integer divide by zero' error. I didn't test it with Unix/Xenix, but assume
  19. it will fail also. 
  20.  
  21. The following patch (Thanks CodeView) in lzhuf.c will fix this bug.
  22. (Sorry, can't do context diffs)
  23.  
  24. 885c885,890
  25. <     i = ((size + (indicator_threshold - 1)) / indicator_threshold);
  26. ---
  27. >     /* Avoid dividing by zero for zero length files */
  28. >     if (size==0) {
  29. >         i = 1; /* draw at least one dot */
  30. >     } else {
  31. >         i = ((size + (indicator_threshold - 1)) / indicator_threshold);
  32. >     };
  33.  
  34. Maybe other MSDOS-Users are interested in a working but undocumented
  35. makefile for MSDOS and MS-C 5.1:
  36.  
  37.  
  38. # Makefile for MS-DOS and MS-C 5.1
  39. # Don't forget to copy dir.h into your sys/ directory
  40. .c.obj:
  41.     cl -c -zi $*.c
  42.     
  43. lharc.obj:
  44.  
  45. dir_dos.obj:
  46.  
  47. lhio.obj:
  48. lzhuf.obj:
  49.     cl -c -ox -zi $*.c
  50.  
  51. mktemp.obj:
  52.  
  53. pipes.obj:
  54.  
  55. lharc.exe: lharc.obj dir_dos.obj lhio.obj lzhuf.obj mktemp.obj pipes.obj
  56.     link /NOE /NOI /CO /st:0x2000 lharc \usr\lib\setargv dir_dos lhio\
  57.                                   lzhuf mktemp pipes,lharc;
  58.  
  59.  
  60.     _____
  61.    /    / .  .                )      /  .  /  /       
  62.        / ___    __  ___      /      /     /  / /   ___
  63.       / /   ) /    /   )    /  /   /  /  /  /(    /___)  
  64.      / (___/ /    (___/    (__/(__/  (  (  (  \  (___
  65.     /                /
  66. (__/             (__/
  67.  
  68. E-Mail: jwilke@cosmo.uucp or ...!unido!cosmo!jwilke
  69.